package cn.tedu.micro.demo.device.controller;

import cn.tedu.micro.demo.common.protocol.JsonResult;
import cn.tedu.micro.demo.common.vo.GunInfoVO;
import cn.tedu.micro.demo.device.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/device/gun/")
public class DeviceController {
    @Autowired
    private DeviceService deviceService;
    @GetMapping("info/{gunId}")
    public JsonResult<GunInfoVO> checkGunStatus(@PathVariable(name="gunId") Integer id){
        GunInfoVO vo=deviceService.checkGunStatus(id);
        return JsonResult.success(vo);//code=0 message="ok" 业务返回data=vo
    }
}
